#ifndef PWAVE_FILEMANAGEMENT_H
#define PWAVE_FILEMANAGEMENT_H

#include "swt_env_win_linux.h"
#include "lct_env_macros.h"

#ifndef _SWT_WIN32_
#define _MAX_PATH 255
#endif


#ifdef USE_GNU_COMPILER

int createdatadir(const char RltDataDir[_MAX_PATH],
                  const char user_code_tag[],
                  const char MainMark[_MAX_PATH],
                  char level3_mark[_MAX_PATH],
                  char outdir[_MAX_PATH],//char out_domain_name[_MAX_PATH],char in_date[],
                  int level,int verbose);
int swt_mkdir(char dir[],size_t mode);
int createdirerror( char rootdir2[],int verbose);
int swt_fun_util_create_code_tag(char tag_out[]=NULL,char username_out[]=NULL,
                                 char domainname_out[]=NULL,int verbose=0);
int fun_csaw_create_dir(// pCSAW_PARAFILE_STRUCT cp,
        const char RltDataDir[], const char fileid[],
        int mpi_myid, int round_i, char outdir[], char domain_name[], char date[]);
int gettime(char date[], int format=0);

#define DIR_MODE_ALL 0760
int swt_mkdir(char dir[],size_t mode=DIR_MODE_ALL);
int swt_getusername(char *username,char *domainname=NULL,int verbose=0);
int swt_getmodulefilename(char filename[],int is_fullname=0);
bool GetCurrent_UserName_Domain(char *username,char *domainname=NULL);
int DelPath(const char filein[],char fileout[],int verbose=0);
int DelFileExt(char filein[],char fileout[]=NULL,int verbose=0);
#ifdef _SWT_WIN32_
BOOL GetTokenByName(HANDLE &hToken,LPSTR lpName);

#endif
int  swt_fullpath(const char pathin[],char pathout[],int verbose=0);
//get module file name in linux;
#ifdef _SWT_XWIN_
int GetModuleFileName_Linux(char* name, int size);
void swt_splitpath(const char* path, char* drv, char* dir, char* name, char* ext);
#endif
bool SWT_GetCurrentDirectory(char *currentdir);
/////////////////////////////////////////

#endif  // USE_GNU_COMPILER

#endif //PWAVE_FILEMANAGEMENT_H
